$(function () {
  // 页数
  var page = 0;
  // 每页展示5个
  var size = 5;
  // dropload
  $(".content").dropload({
    scrollArea: window,
    domDown: {
      domClass: 'dropload-down',
      domRefresh: '<div class="dropload-refresh">上拉加载更多</div>',
      domLoad: '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
      domNoData: '<div class="dropload-noData">已加载完</div>'
    },
    loadDownFn: function (me) {
      page++;
      // 拼接HTML

      var sval = {
        seq_id: seq_id,
        pageindex: page,
          pagerows: size
      };
console.log(sval)
      function doCallBack(ret) {
        if (ret.retcode == 0) {
          var result = JSON.parse(Base64.decode(ret.data));
          console.log(result)
          //标题
          document.title = result.share_title;
          //循环获取内容
          var goodsmodel = result.goodslist;

          var arrRows = goodsmodel.allrows;
          var arrLen = goodsmodel.list.length;
          if (arrLen > 0) {


            // 如果没有数据
          } else {
            //  锁定
            me.lock();
            // 无数据
            me.noData();
          }
          setTimeout(function () {
            // 插入数据到页面，放到最后面
            var html = templateDate(goodsmodel);
            $(".lists").append(html);
            // 每次数据插入，必须重置
            me.resetload();
          }, 1000);
          if (arrRows < size) {
            me.lock();
            me.noData();
            tabLoadEndArray[itemIndex] = true;
            me.resetload();
            $('.dropload-down').hide();
          } else {
            $('.dropload-down').show();
          }
        } else {
          // noRecord($(".lists"))
          // me.lock(); // 锁定
          // me.noData(); // 无数据
          $('.dropload-down').hide();
        }
      }
      jAjax("huodong.getshare", doCallBack, sval);
    }
  });
});

function templateDate(data) {
  var htmlfinborListData = template("allList", data);
  return htmlfinborListData;
}